// 引入菜单列表接口
import {menuList} from '../../../request/api'

const state = {
    menulist:[]
};
const getters = {
    getMenuList(state) {
        return state.menulist;
      },
};
const mutations = {
    REQ_MENULIST(state,payload){
        state.menulist = payload
    }
}
const actions = {
    async changeMenuAction({commit}){
        let res = await menuList({
            istree:1
        })
        console.log(res,'菜单列表');
        commit('REQ_MENULIST',res.data.list)
    }
}
export default {
    state,
    getters,
    mutations,
    actions,
    // 开启命名空间
    namespaced:true
}